function generate_mips_autodoc(install_dir)
% generate_mips_autodoc - Generate the stubs and symlinks for Ref Manual.
% ::
%
%   generate_mips_autodoc(install_dir)
%
% Inputs:
%   install_dir (char array) : path to the install directory for the package
%
% Creates the .rst stubs and symlinks to the source files for all functions
% and classes to be included in the Reference Manual. Creates all of the
% inputs (lists of functions and classes) to pass to generate_autodoc_stubs
% and generate_source_symlinks.

%   MIPS
%   Copyright (c) 2023-2024, Power Systems Engineering Research Center (PSERC)
%   by Ray Zimmerman, PSERC Cornell
%
%   This file is part of MIPS.
%   Covered by the 3-clause BSD License (see LICENSE file for details).
%   See https://github.com/MATPOWER/mips for more info.

if nargin < 1
    matpower_dir = '~/dev/projects/mips/';
end

sphinx_src_dir = [matpower_dir 'docs/sphinx/source/'];

lib_fcns = {
    'have_feature_lu_vec', ...
    'have_feature_pardiso_legacy', ...
    'have_feature_pardiso_object', ...
    'have_feature_pardiso', ...
    'mips', ...
    'mipsver', ...
    'mplinsolve', ...
    'qps_mips', ...
};
lib_t_fcns = {
    'mips_example1', ...
    'mips_example2', ...
    'test_mips', ...
    't_mips', ...
    't_mips_pardiso', ...
    't_mplinsolve', ...
    't_qps_mips', ...
};
%     'generate_mips_autodoc', ...


in = struct(...
    'function', struct(...
        'destdir', 'functions', ...
        'gh_base_url', 'https://github.com/MATPOWER/mips/blob/master', ...
        'list', struct(...
            'mod', {'mips', 'mips'}, ...
            'src_path', {'lib', 'lib/t'}, ...
            'names', {lib_fcns, lib_t_fcns} ...
        ) ...
    ) ...
);

%% create stubs and symlinks for reference manual
generate_autodoc_stubs(in, sphinx_src_dir);
generate_source_symlinks(in, [sphinx_src_dir 'matlab-source/'], '../../../../../');
